<?php
/*
	代理设置
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'commission';

if($_RQ['op']=='commission'){
	if($_RQ['postdata']){
		$post=get_postdata();
		
		$this->plugin_setting('commission',$post);
		exi('设置成功！');
	}
	$setting=$this->plugin_setting('commission');
	$return['item']=$setting;
	$return['item']['url']=custom_url('jy_move_agentcar/member.login/',true);
	$return['htmls']=array(
		'type'=>'edit',
		'edit'=>array(
			array('type'=>'copy','name'=>'url','title'=>'代理商PC端后台入口','help'=>'','read'=>true),
			array('type'=>'switch','name'=>'open_commission','title'=>'是否开启代理分红','help'=>''),
			array('type'=>'string','name'=>'commission_per_1','title'=>'省级代理分红比例','help'=>'请填写百分数，例如填写10，表示将订单金额的10%作为分红给省级代理商。下同'),
			array('type'=>'string','name'=>'commission_per_2','title'=>'市级代理分红比例','help'=>''),
			array('type'=>'string','name'=>'commission_per_3','title'=>'县级代理分红比例','help'=>''),
			array('type'=>'switch','name'=>'check_commission','title'=>'是否自动审核佣金','help'=>''),
		),
	);
	exi($return);
}
